function lun1(){
	var som=0
	dsq1=setInterval(()=>{
	som++
	if(som>4){
		$('.toulun').css('top',-35)
		som=2
	}
	$('.toulun').animate({top:-som*35},500)
},2000)
}
lun1()

var dao1=document.querySelector('.daobox')
window.onscroll=function(){
	let gun1=window.pageYOffset
	
	if(gun1>100){
		dao1.style.position='fixed'
		dao1.style.borderBottom='3px solid #000'
		dao1.style.zIndex='5'
	}else{
		dao1.style.position=''
		dao1.style.border=''
		dao1.style.zIndex=''
	}
}
//鼠标移入事件
var boy1=document.body
var $xian1=$('.shou12_yi>:nth-child(2)')
var yi1=document.querySelector('.shou12>:nth-child(1)')
var yi2=document.querySelector('.shou12>:nth-child(2)')
yi1.onmousemove=function(){
	$('.shou12_yi>:nth-child(1)').css({display:'block',zIndex:8})
}
yi1.onmouseout=function(){
	$('.shou12_yi>:nth-child(1)').css({display:'none'})
}

// 移入2
yi2.onmousemove=function(){
	$('.shou12_yi>:nth-child(2)').css({display:'block'})
}
yi2.onmouseout=function(){

		$('.shou12_yi>:nth-child(2)').css({display:'none'})

}
var yi22=document.querySelector('.shou12_yi>:nth-child(2)')
yi22.onmouseenter=function(){
	yi22.style.display='block'
}
yi22.onmouseleave=function(){
	yi22.style.display='none'
}

var deng1=document.querySelector('#nb')
//登录的点击
var us1=document.querySelector('#us1') //账号
var pwd1=document.querySelector('#pwd')// 密码
deng1.onclick=function(){
	var u1=us1.value
	var p1=pwd1.value
	// 通过ajax来发送请求
	$.ajax({
		url:'./php/deng.php',
		data:{
			"username":u1,
			"password":p1
		},
		success:function(dt){
			if(dt==1){
				location.href='./xiang.html'
				setcook('name',u1)
			}else{
				alert('账号或密码错误')
			}
		}
	})
    // $.ajax({
	// 	type: "get",
	// 	url: "./php/deng.php",
	// 	success: function (dt) {
	// 		console.log(dt)
	// 	}
	// });
}
//手机号或者密码登录
var $xin1=$('.lf-1>:nth-child(2)>:nth-child(1)')
var $xin2=$('.lf-1>:nth-child(2)>:nth-child(2)')
$xin1.click(function(){
	$('.nrlf>:nth-child(1)').css('display','block')
	$('.nrlf>:nth-child(2)').css('display','none')
})
$xin2.click(function(){
	$('.nrlf>:nth-child(2)').css('display','block')
	$('.nrlf>:nth-child(1)').css('display','none')
})